import { defineStore } from 'pinia'

export const useDomain = defineStore('domain', {
  state: () => ({
    domains: [] as string[]
  }),

  actions: {
    async getDomains() {
      const { data } = await useFetch<string[]>('/api/domain/list', {
        method: 'GET'
        // null:false
      })
      this.domains = data.value || []
    }
  }
})
